﻿@model QzgfFrame.System.RoleManger.Models.SystemRole
@*
多模型关连
model Tuple< QzgfFrame.System.MenuManger.Models.SystemMenu, QzgfFrame.System.RoleManger.Models.SystemRole>
@Html.TextBoxFor(m=>m.Item1.Pic)
@Html.TextBoxFor(m=>m.Item2.Rolename)
*@
          
@{
    ViewBag.Title = "Register";
}       

@using (Html.BeginForm("edit", "Role", FormMethod.Post, new { name = "form1", id = "form1" }))
{
    @Html.HiddenFor(m => m.Id)
    @Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.")
       <div>
        <table cellpadding="0" border="0" cellspacing="0" class="edittable">
            <tbody>
                <tr>
                    <td align="right" class="editcellmessage">角色名称</td>
                    <td align="right" class="editcellverify"><div class="l-verify-star">*</div></td>
                    <td align="left" class="editcell">
                    @Html.TextBoxFor(m => m.Rolename, new { validate = "{required:true,minlength:1}", ltype = "text" })
                </tr>
                <tr>
                    <td align="right" class="editcellmessage">备注</td>
                    <td align="right" class="editcellverify"><div class="l-verify-star"></div></td>
                    <td align="left" class="editcell">
                    @Html.TextAreaFor(m => m.Remark, new { ltype = "text" })
                    </td> 
                </tr>
                <!--
                 <tr>
                    <td align="right" class="editcellmessage">时间</td>
                    <td align="right" class="editcellverify"><div class="l-verify-star">*</div></td>
                    <td align="left" class="editcell">
                    @*
                    @Html.EditorFor(m => m.Createdate)
                    *@
                     
                    </td> 
                </tr>
                -->
            </tbody>
        </table>
    </div> 
}
    <script src="@Url.Content("~/Lib/jquery-validation/jquery.validate.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Lib/jquery-validation/messages_cn.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Lib/jquery-validation/jquery.metadata.js")" type="text/javascript"></script>
    <script type="text/javascript">
        //var CurID =  <%=CurID %>;
        var Validator = null;
        $(function () {
            //$("#Createdate").ligerDateEditor({ showTime: true, format: "yyyy-MM-dd hh:mm" });
            //处理下拉框 
           $("#form1").ligerForm();
           $.metadata.setType("attr", "validate");
            deafultValidate($("#form1"));
            Validator = $("#form1").validate();
        });

        function f_success() {
            $(document).ready(function () {
                $.ligerDialog.confirm("是否继续编辑", "保存成功", function (ok) {
                    $.ligerDialog.closeWaitting();
                    parent.window.frames["mainframe"].f_reload();
                    if (!ok) {
                        parent.window.frames["mainframe"].f_closeWindow();
                    }
                });
            });
        }
        function f_error(message) {
            $(document).ready(function () {
                $.ligerDialog.error(message);
            });
        }
        function f_save() {
            if(!Validator.form()) return;
            $.ligerDialog.waitting("正在保存中...");
            //提交数据
            document.forms[0].submit();
        } 
    </script>
     <style type="text/css">
        .edittable .editcellmessage,.edittable .editcellverify,.edittable .editcell{ padding:4px;line-height:23px;}
        .edittable .editcellmessage{ padding-left:20px;} 
        body { font-size:12px; background:white;}
    </style>